/*
 * @(#)TradeType.java 创建于 2016-07-15 11:39:01
 *
 * 版权：版权所有 Bsoft 保留所有权力。
 */
package com.bsoft.gol.hcb.utils;

/**
 * @author <a href="mailto:chinnsii@163.com">zhengshi</a>
 */
public enum TradeType {

    //FIXME 此处配置作废  不再使用  代码迁移至hcn-pay !!!!!!!!!!!!!!!!!!!!!!

    inpatientFee("01", "住院预缴金"), diagnosisFee("02", "诊间支付"), tabeTicketFee("03", "签到取号"),
    consultPayFee("04","在线问诊"),signPayFee("05","家医服务包支付"),visitingFee("06","上门服务"),scanOrVipcnFee("07","家医服务包扫码、公众号支付"),blCopyPayFee("09","病历复印");

    private String code;
    private String display;

    TradeType(String code, String display) {
        this.code = code;
        this.display = display;
    }

    public String getCode() {
        return code;
    }

    public String getDisplay() {
        return display;
    }

    public static TradeType getTradeType(String code) {
        int i = Integer.parseInt(code);
        if (i < 1 || i > values().length) {
            return null;
        }
        return values()[i - 1];
    }

    public static String getDisplay(String code) {
        TradeType tradeType = getTradeType(code);
        return tradeType == null ? "" : tradeType.getDisplay();
    }
}
